home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / nrpas13.zip / BCUINT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  897b  |  32 lines

  1. PROCEDURE bcuint(y,y1,y2,y12: gl4array; x1l,x1u,x2l,x2u,x1,x2: real;
  2.         VAR ansy,ansy1,ansy2: real);
  3. (* Programs using procedure BCUINT must define the types
  4. TYPE
  5.    gl4array = ARRAY [1..4] OF real;
  6.    gl4by4 = ARRAY [1..4,1..4] OF real;
  7. in the main routine. *)
  8. VAR
  9.    i: integer;
  10.    t,u,d1,d2: real;
  11.    c: gl4by4;
  12. BEGIN
  13.    d1 := x1u-x1l;
  14.    d2 := x2u-x2l;
  15.    bcucof(y,y1,y2,y12,d1,d2,c);
  16.    IF ((x1u = x1l) OR (x2u = x2l)) THEN BEGIN
  17.       writeln('pause in routine BCUINT - bad input'); readln
  18.    END;
  19.    t := (x1-x1l)/d1;
  20.    u := (x2-x2l)/d2;
  21.    ansy := 0.0;
  22.    ansy2 := 0.0;
  23.    ansy1 := 0.0;
  24.    FOR i := 4 DOWNTO 1 DO BEGIN
  25.       ansy := t*ansy+((c[i,4]*u+c[i,3])*u+c[i,2])*u+c[i,1];
  26.       ansy2 := t*ansy2+(3.0*c[i,4]*u+2.0*c[i,3])*u+c[i,2];
  27.       ansy1 := u*ansy1+(3.0*c[4,i]*t+2.0*c[3,i])*t+c[2,i]
  28.    END;
  29.    ansy1 := ansy1/d1;
  30.    ansy2 := ansy2/d2
  31. END;
  32.